<?php 
namespace Common\Model;
use Think\Model\RelationModel;
class YgclTeacherContentsModel extends RelationModel{
	
	protected $_link = array(
			'users'=>array(
					'mapping_type'=>self::BELONGS_TO,
					'class_name' => 'Users',
					'foreign_key' => 'creator_id'
			),
			'files'=>array(
					'mapping_type'=>self::HAS_MANY,
					'class_name'  =>'MaterialFiles',
					'foreign_key'=>'fk_id',
					'condition' => 'fk_group="content"',
			),
			'imglist'=>array(
					'mapping_type'=>self::HAS_MANY,
					'class_name'  =>'MaterialImages',
					'foreign_key'=>'fk_id',
					'condition' => 'fk_group="content"',
			),
			'fengmian'=>array(
					'mapping_type'=>self::BELONGS_TO,
					'class_name' => 'MaterialImages',
					'foreign_key' => 'img_id'
			),
	);
	
}
?>